<?php
declare(strict_types=1);

/**
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 * @link      https://cakephp.org CakePHP(tm) Project
 * @since     0.2.9
 * @license   https://opensource.org/licenses/mit-license.php MIT License
 */
namespace App\Controller;


/**
 * Static content controller
 *
 * This controller will render views from templates/Pages/
 *
 * @link https://book.cakephp.org/4/en/controllers/pages-controller.html
 */
class UsersController extends AppController
{
	public function initialize(): void
    {
        parent::initialize();
        $this->loadComponent('RequestHandler');
    }

    public function getIndex()
    {
        // Set the view vars that have to be serialized.
		$a = [
			'a'=>1,
			'b'=>2
		];
		//pr($this->request->getAttribute('params'));
        $this->set('data', time());

    }

	public function view(){

	}

	public function add($title)
	{
		$article = $this->Articles->newEntity();
		$article = $this->Articles->patchEntity($article, ['title'=>$title]);
		if ($this->Articles->save($article)) {
			 $this->set('data', $article);
		}
	}

	public function login()
    {

    }

}
